'use strict';

module.exports = {

  up: async (queryInterface, Sequelize) => {
    const { INTEGER, DATE, STRING, TEXT, BOOLEAN } = Sequelize;
    await queryInterface.createTable('users', {
      id: { type: INTEGER, primaryKey: true, autoIncrement: true },
      nick: STRING,
      city: STRING,
      age: INTEGER,
      head_image: STRING,
      wechat: STRING,
      phone: STRING,
      profession: STRING,
      company: STRING,
      favour: INTEGER,
      desc: TEXT,
      role_id: INTEGER,
      money: INTEGER,
      authentication: BOOLEAN,
      created_at: DATE,
      updated_at: DATE,
    });
  },

  down: async (queryInterface, Sequelize) => {
    /*
      Add reverting commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.dropTable('users');
    */
  },
};
